package com.kj.tms.system.service.menu.serviceImpl;


import com.kj.tms.common.bean.dao.BaseMapper;
import com.kj.tms.common.bean.dto.Pager;
import com.kj.tms.common.bean.service.BaseService;
import com.kj.tms.pri.system.menu.dto.DictDto;
import com.kj.tms.pri.system.menu.dto.LoggerEntity;
import com.kj.tms.pri.system.menu.service.LoggerService;
import com.kj.tms.system.service.menu.dao.LoggerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ProjectName: etms
 * @Package: com.hongtu.tms.system.maint.service
 * @ClassName: ${TYPE_NAME}
 * @Description: []
 * @Author: [yangruidong]
 * @CreateDate: 2018/7/5 10:30
 * @UpdateUser: []
 * @UpdateDate: 2018/7/5 10:30
 * @UpdateRemark: []
 * @Version: 1.0
 * Copyright: 北京宏图天安 Copyright (c) 2018
 */
@RestController
public class LoggerServiceImpl extends BaseService<LoggerEntity> implements LoggerService {

    @Autowired
    private LoggerMapper loggerMapper;


    @Override
    public BaseMapper<LoggerEntity> getMapper() {
        return loggerMapper;
    }

    @Override
    public void insertLogger(@RequestBody LoggerEntity log) throws Exception{
        loggerMapper.insertLogger(log);
    }

    @Override
    public Pager listByCondition(@RequestBody LoggerEntity log) throws Exception{

        return  super.selectPage(log);

    }

    @Override
    public void deleteByCondition(@RequestBody LoggerEntity log) throws Exception{
        loggerMapper.deleteByCondition(log);
    }

    @Override
    public  String getElkUrl(@RequestParam(value = "dictType") String dictType ){
      List<DictDto> curlList= loggerMapper.getElkUrl(dictType);
      return  curlList.get(0).getDictCode();
    }

}
